package collection;

import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.Collection;

public class CollectionOperDemo {
    public static void main(String[] args) {
        Collection<Point> c1=new ArrayList();
        c1.add(new Point(4,6));
        c1.add(new Point(5,6));
        c1.add(new Point(6,7));
        c1.add(new Point(45,8));
        c1.add(new Point(7,9));
        System.out.println(c1);
        Collection<Point> c2=new ArrayList();
        c2.add(new Point(7,9));
        c2.add(new Point(5,8));
        c2.add(new Point(5,9));
        c2.add(new Point(34,6));
        c2.add(new Point(7,76));
        c1.addAll(c2);
        System.out.println(c2);
        System.out.println("c1:"+c1);
        System.out.println(c1.containsAll(c2));
//        c1.retainAll(c2);
//        System.out.println(c1);
//        c1.removeAll(c2);
//        System.out.println(c1);
        for(Object o:c1){
            System.out.println(o);
        }
    }
}
